Skip to content

spec(v1.0): rename @table → @dataset, add @proto, expand reserved names#9

Merged
trendvidia merged 2 commits into
mainfrom
v1.0-spec-rename
May 13, 2026
Merged

spec(v1.0): rename @table → @dataset, add @proto, expand reserved names#9
trendvidia merged 2 commits into
mainfrom
v1.0-spec-rename

Conversation

@trendvidia
Copy link
Copy Markdown
Owner

Summary

Lockstep major-version cut alongside the protowire v1.0 spec freeze and protowire-cpp v1.0.0, which this port wraps via the nanobind FFI. Hard cutover, no alias period.

Python API rename surface

Before After
pxf.TableDirective pxf.DatasetDirective
pxf.TableReader pxf.DatasetReader
pxf.Result.tables pxf.Result.datasets
pxf.ProtoDirective + pxf.ProtoShape (new)
pxf.Result.protos: tuple[ProtoDirective, ...] (new)

FFI shape change

_protowire.pxf_unmarshal_full now returns a 6-tuple (raw, set_paths, null_paths, directives, datasets, protos). The cpp side surfaces ProtoDirective as a (shape, type_name, body) tuple; Python wraps it into the new frozen dataclass with the shape field typed as Literal["anonymous", "named", "source", "descriptor"].

Source files renamed

  • tests/test_pxf_table_reader.pytests/test_pxf_dataset_reader.py
  • All internal PyTableReader / PyTableDirective / etc. renamed in src/_protowire/module.cc.

Test plan

  • pip install -e . against the v1.0.0 sibling cpp checkout
  • pytest: 100 tests, 0 failures
  • New tests/test_pxf_proto_directive.py with 16 cases — all four @proto body shapes via FFI roundtrip, multi-@proto, nested-brace bodies, three error paths, parametrized reserved-directive-name rejection, ProtoDirective dataclass check

Version bumps

  • pyproject.toml 0.75.01.0.0
  • src/protowire/__init__.py __version__ 0.75.01.0.0

Lockstep v1.0 ports

See the protowire v1.0.0 release for the full lockstep table. With this PR merged + tagged, protowire-python ships as protowire==1.0.0 on PyPI.

Lockstep major-version cut alongside the protowire v1.0 spec freeze
and protowire-cpp v1.0.0 (which this port wraps via nanobind).
Hard cutover, no alias period.

Python API rename surface:
  pxf.TableDirective → pxf.DatasetDirective
  pxf.TableReader    → pxf.DatasetReader
  pxf.Result.tables  → pxf.Result.datasets
  + pxf.ProtoDirective + pxf.ProtoShape                     (new)
  + Result.protos: tuple[ProtoDirective, ...]               (new)

FFI shape change: _protowire.pxf_unmarshal_full now returns a
6-tuple (raw, set_paths, null_paths, directives, datasets, protos).
The cpp side surfaces ProtoDirective as a (shape, type_name, body)
tuple; Python wraps it into the new frozen dataclass.

Source files renamed:
  src/_protowire/module.cc           (PyTableReader → PyDatasetReader)
  src/protowire/pxf.py               (class + helper renames)
  tests/test_pxf_table_reader.py  → tests/test_pxf_dataset_reader.py

New: tests/test_pxf_proto_directive.py with 16 cases covering all
four @proto body shapes through the FFI, multi-@proto, nested
braces, three error paths, parametrized reserved-name rejection,
and a ProtoDirective dataclass check.

Version bumps:
  pyproject.toml         0.75.0 → 1.0.0
  src/protowire/__init__ 0.75.0 → 1.0.0

pytest: 100 tests, 0 failures.
The CI / publish / codeql workflows pinned the sibling cpp checkout
to v0.75.0 — the Python source compiles against the v1.0 API surface
(Datasets / Protos / DatasetReader) and fails against the older
TableReader / Tables surface.

Local builds passed because the local protowire-cpp checkout is at
main (v1.0.0); CI's pinned checkout was the v0.75.0 tag.
@trendvidia trendvidia merged commit 9154de2 into main May 13, 2026
18 checks passed
@trendvidia trendvidia deleted the v1.0-spec-rename branch May 13, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant